package test04.demo00.tx01;

public class MainTest {
    public static void main(String[] args) throws InterruptedException {
        // 创建线程对象 - 并初始化线程需要的数据
        MyThread myThread = new MyThread(1,100);
        MyThread myThread2 = new MyThread(101,900);
        MyThread myThread3 = new MyThread(901,1000);

        // 启动线程 - run
        myThread.start();
        myThread2.start();
        myThread3.start();

        //Thread.sleep(1);
        myThread.join();
        myThread2.join();
        myThread3.join();

        int s = myThread.getSum() + myThread2.getSum() + myThread3.getSum();
        System.out.println("和为："+s);
    }
}
